﻿using System;
using System.Xml.Serialization;
using Kiva7.Translations;

namespace Kiva7.DataClasses
{
    public class Lender
    {
        [XmlElement("lender_id")]
        public string LenderId { get; set; }

        [XmlElement("name")]
        public string Name { get; set; }

        [XmlElement("image")]
        public Image Image { get; set; }

        [XmlElement("whereabouts")]
        public string WhereAbouts { get; set; }

        [XmlElement("country_code")]
        public string CountryCode { get; set; }

        [XmlElement("uid")]
        public string Uid { get; set; }

        [XmlElement("member_since")]
        public DateTime? MemberSince { get; set; }

        [XmlElement("personal_url")]
        public string PersonalUrl { get; set; }        

        [XmlElement("occupation")]
        public string Occupation {get; set;}

        [XmlElement("loan_because")]
        public string LoanBecause { get; set; }

        private Translation _LoanBecauseTranslation;
        [XmlIgnore]
        public Translation LoanBecauseTranslation
        {
            get
            {
                if (_LoanBecauseTranslation == null)
                {
                    _LoanBecauseTranslation = new Translation(LoanBecause);
                }
                return _LoanBecauseTranslation;
            }
        }

        [XmlElement("occupational_info")]
        public string OccupationalInfo { get; set; }

        private Translation _OccupationalInfoTranslation;
        [XmlIgnore]
        public Translation OccupationalInfoTranslation
        {
            get
            {
                if (_OccupationalInfoTranslation == null)
                {
                    _OccupationalInfoTranslation = new Translation(OccupationalInfo);
                }
                return _OccupationalInfoTranslation;
            }
        }

        [XmlElement("loan_count")]
        public int LoanCount { get; set; }

        [XmlElement("invitee_count")]
        public int InviteeCount { get; set; }
    }
}
